import Layout from '@/layout/index.vue'

const competitionRouter = [
  {
    path: '/competition',
    component: Layout,
    redirect: '/competition/my',
    name: 'competition',
    meta: {
      title: '竞赛管理',
      icon: 'competition-svg',
      roles: ['department', 'teacher'],
    },
    children: [
      {
        path: '/competition/my',
        component: () => import('@/views/competition/index.vue'),
        name: 'Competition',
        meta: { title: '我的竞赛', icon: 'mycp-svg', roles: ['department', 'teacher'] },
      },
      {
        path: '/competition/add',
        component: () => import('@/views/competition/write/index.vue'),
        name: 'addCompetition',
        meta: { title: '新增竞赛', icon: 'Document', roles: ['department', 'teacher'] },
      },
      {
        path: '/competition/edit/:id',
        component: () => import('@/views/competition/write/edit.vue'),
        name: 'editCompetition',
        meta: { title: '编辑竞赛', icon: 'Document', roles: ['department', 'teacher'] },
      },
      {
        path: '/competition/category',
        component: () => import('@/views/competition/category/index.vue'),
        name: 'categoryCompetition',
        meta: { title: '竞赛分类', icon: 'category-svg', roles: ['department', 'teacher'] },
      },
      {
        path: '/competition/logicFlow/:id',
        component: () => import('@/views/competition/LogicFlow/index.vue'),
        name: 'logicFlowCompetition',
        meta: {
          title: '流程编排',
          keepAlive: true,
          icon: 'testzw-svg',
          roles: ['department', 'teacher'],
          activeMenu: '/competition/category',
        },
      },
    ],
  },
]

export default competitionRouter
